Allow all trace-buffer hypercalls to be executed even when tracing is currently disabled.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 1 Jun 2006 20:34:47 +0000 (21:34 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 1 Jun 2006 20:34:47 +0000 (21:34 +0100)
From: George Dunlap
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/common/trace.c

index 0cee7126d273ac702b9f376a43fe6b16c4eda091..6a7827299aba072b2ccbb25fa37ece2e4dff22c6 100644 (file)
@@ -178,20 +178,12 @@ int tb_control(dom0_tbufcontrol_t *tbc)
 
     spin_lock(&lock);
 
-    if ( !tb_init_done &&
-         (tbc->op != DOM0_TBUF_SET_SIZE) &&
-         (tbc->op != DOM0_TBUF_ENABLE) )
-    {
-        spin_unlock(&lock);
-        return -EINVAL;
-    }
-
     switch ( tbc->op )
     {
     case DOM0_TBUF_GET_INFO:
         tbc->cpu_mask   = tb_cpu_mask;
         tbc->evt_mask   = tb_event_mask;
-        tbc->buffer_mfn = __pa(t_bufs[0]) >> PAGE_SHIFT;
+        tbc->buffer_mfn = opt_tbuf_size ? virt_to_mfn(t_bufs[0]) : 0UL;
         tbc->size       = opt_tbuf_size * PAGE_SIZE;
         break;
     case DOM0_TBUF_SET_CPU_MASK: